#include "visitor.h"
#include "stmt.h"
#include "opcode.h"

Context* Program::globalContext = 0;

void Statement::accept(Visitor* v){
    v->visitStatement(*this);
}

void Block::accept(Visitor* v){
    v->visitBlock(*this);
}

void Program::accept(Visitor* v){
    Context::curContext = globalContext;
    block->accept(v);
}

void AssignmentStatement::accept(Visitor* v){
    v->visitAssignment(*this);
}

void VariableDeclareStatement::accept(Visitor* v){
    v->visitVariableDeclare(*this);
}

void ParameterListStatement::accept(Visitor* v){
    v->visitParameterList(*this);
}

void VariableListStatement::accept(Visitor* v){
    v->visitVariableList(*this);
}

void ExprListStatement::accept(Visitor* v){
    v->visitExprList(*this);
}

void FunctionDefStatement::accept(Visitor* v){
    v->visitFunctionDef(*this);
}

void FunctionCallStatement::accept(Visitor *v){
    v->visitFunctionCall(*this);
}

void WhileStatement::accept(Visitor *v){
    v->visitWhileStatement(*this);
}

void IfStatement::accept(Visitor *v){
    v->visitIfStatement(*this);
}


